#ifndef MYSQLTABLEMODEL_H
#define MYSQLTABLEMODEL_H

#include <QSqlTableModel>
#include <QSqlRecord>
#include <QStringList>


class MySqlTableModel : public QSqlTableModel
{
public:
    MySqlTableModel(QObject * parent = 0, QSqlDatabase db = QSqlDatabase());
    ~MySqlTableModel();
    QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;  // 重载实现居中显示
    //Qt::ItemFlags flags(const QModelIndex &index) const;
    bool recordContains(QSqlRecord *record, QVector<QString> name);  // 记录是否包含字段
    bool recordSetValue(QSqlRecord *record, QVector<QString> name, QVector<QVariant> value);  // 设置记录字段对应的值

};

#endif // MYSQLTABLEMODEL_H
